import { hopeTheme } from "vuepress-theme-hope";
import {zhNavbar} from "./navbar.ts";
import {zhSidebar} from "./sidebar.ts";


export default hopeTheme({
  hostname: "https://www.aligis.cn",

  author: {
    name: "aligis",
    url: "https://www.aligis.cn",
  },

  iconAssets: "iconfont",

  logo: "/logo.jfif",

  repo: "web-blog-study",
  // docsRepo:"https://gitee.com/Drmevip/web-blog-study",
  docsRepo:"",
  repoLabel:"gitee",

  // 是否在导航栏内显示仓库链接，默认为 `true`
  repoDisplay: false,

  docsDir: "docs",


  blog: {
    name:"晓拒霜",
    description: "像我这样的人",
    roundAvatar:true,
    // sidebarDisplay:"always",
    medias: {
      Email: "drmevip@163.com",
      Gitee: "https://gitee.com/Drmevip",
      // GitHub: "https://github.com/DrmeAlan",
      Gmail: "D29600M@gmail.com",
      QQ: "290069291",
      Wechat: "Q290069291",
    },
  },

  navbar: zhNavbar,

  navbarLayout: {
    start: ["Brand"],
    // center: [],
    end: ["Search","Links","Language", "Repo", "Outlook"],
  },

  // sidebar
  sidebar: zhSidebar,
  fullscreen:true,

  pageInfo:["Author", "Original", "Date", "Category", "Tag", "ReadingTime","Word","PageView"],

  footer: `<div style="width:auto;margin:0 auto; padding:20px 0;"><a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=61010402000632" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="" data-lazy-src="" style="float:left;" data-ll-status="loading" class="entered loading">陕公网安备 61010402000632 号</a><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/" style="text-decoration:none;margin-left:10px;">陕 ICP 备 2021009417 号 - 3</a></div>`,

  displayFooter: true,
  metaLocales: {
    editLink: "在 gitee 上编辑此页",
  },
  encrypt: {
    config: {
      "/demo/encrypt.html": ["1234"],
      "/zh/demo/encrypt.html": ["1q2w3E"],
    },
  },

  plugins: {
    
    // searchPro: {
      // 索引全部内容
      // indexContent: true,
      // locales: {
      //   "/zh/": {
      //     placeholder: "搜索",
      //   },
      // },
      // 为分类和标签添加索引
      // customFields: [{
      //   name: "author",
      //   getter: (page: { frontmatter: { author: any; }; }) => page.frontmatter.author,
      //   formatter: "作者：$content",
      // },
      //   {
      //     getter: (page: { frontmatter: { category: any; }; }) => page.frontmatter.category,
      //     formatter: "分类：$content",
      //   },
      //   {
      //     getter: (page: { frontmatter: { tag: any; }; }) => page.frontmatter.tag,
      //     formatter: "标签：$content",
      //   }, 
      //   {
      //     name: "updateTime",
      //     getter: (page: { data: { git: { updateTime: { toLocaleString: () => any; }; }; }; }) => page.data.git?.updateTime.toLocaleString(),
      //     formatter: {
      //       "/": "Update time: $content",
      //       "/zh/": "更新时间：$content",
      //     },
      //   }
      // ],
  // },
    blog: true,

    // copyCode:{
    //   showInMobile: true
    // },
    // If you don’t need comment feature, you can remove following option
    // The following config is for demo ONLY, if you need comment feature, please generate and use your own config, see comment plugin documentation for details.
    // To avoid disturbing the theme developer and consuming his resources, please DO NOT use the following config directly in your production environment!!!!!
    comment: {
      /**
       * <script src="https://giscus.app/client.js"
        data-repo="DrmeAlan/aligis"
        data-repo-id="R_kgDOLODxHQ"
        data-category="General"
        data-category-id="DIC_kwDOLODxHc4Cc824"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="light"
        data-lang="zh-CN"
        crossorigin="anonymous"
        async>
        </script>
       * Using Giscus
       */
       provider: "Giscus",
       repo: "DrmeAlan/aligis",
       repoId: "R_kgDOLODxHQ",
       category: "General",
       categoryId: "DIC_kwDOLODxHc4Cc824",
       mapping: "pathname",
      //  strict: "0",
       lazyLoading: true,
       inputPosition:"bottom"
      /**
       * Using Twikoo
       */
      // provider: "Twikoo",
      // envId: "https://twikoo.ccknbc.vercel.app",

      /**
       * Using Waline
       */
      // provider: "Waline",
      // serverURL: "https://blog.aligis.cn/",

      /**
       * Using artalk
       */
      // provider: "Artalk",
      // site: "artalk-demo",
      // server: "https://demo-artalk.jjdxb.top/",
    },

    // Disable features you don’t want here
    mdEnhance: {
     // 添加选项卡支持
      tabs: true,
      codetabs: true,
      chart: true,
      echarts: true,
      alert: true,
      // 启用 kotlin 交互演示
      kotlinPlayground: false,
      // 流程图  pnpm add -D mermaid
      mermaid: false,
      // 使用 KaTeX 启用 TeX 支持 pnpm add -D katex  || pnpm add -D mathjax-full
      katex: false,
      // 使用 mathjax 启用 TeX 支持
      mathjax: false,
      // 启用 vue 交互演示  pnpm add -D @vue/repl
      vuePlayground: false,
      // 启用下角标功能
      sub: true,
      // 启用上角标
      sup: true,
      demo: true,
      tasklist: true,
      // 启用 figure
      figure: true,
      // 启用图片懒加载
      imgLazyload: true,
      // 启用图片标记
      imgMark: true,
      // 启用图片大小
      imgSize: true,
      // 导入文件
      include: true,
      attrs: true,
      // 幻灯片  pnpm add -D reveal.js
      revealJs: false,
      // 使用 == == 进行标记。请注意两边需要有空格。
      hint: true,
      // 创建行内 snippet，对内联标记进行样式化，包括更改标签、添加属性和修改内容。
      stylize: [
        {
          matcher: "Recommended",
          replacer: ({ tag }) => {
            if (tag === "em")
              return {
                tag: "Badge",
                attrs: { type: "tip" },
                content: "Recommended",
              };
          },
        },
      ],
      // 流程图
      flowchart: true,
      // 脚注
      footnote:true,
      // 自定义内容对齐方式。
      align: true,
    },

    // uncomment these if you want a PWA
    // pwa: {
    //   favicon: "/favicon.ico",
    //   cacheHTML: true,
    //   cachePic: true,
    //   appendBase: true,
    //   apple: {
    //     icon: "/assets/icon/apple-icon-152.png",
    //     statusBarColor: "black",
    //   },
    //   msTile: {
    //     image: "/assets/icon/ms-icon-144.png",
    //     color: "#ffffff",
    //   },
    //   manifest: {
    //     icons: [
    //       {
    //         src: "/assets/icon/chrome-mask-512.png",
    //         sizes: "512x512",
    //         purpose: "maskable",
    //         type: "image/png",
    //       },
    //       {
    //         src: "/assets/icon/chrome-mask-192.png",
    //         sizes: "192x192",
    //         purpose: "maskable",
    //         type: "image/png",
    //       },
    //       {
    //         src: "/assets/icon/chrome-512.png",
    //         sizes: "512x512",
    //         type: "image/png",
    //       },
    //       {
    //         src: "/assets/icon/chrome-192.png",
    //         sizes: "192x192",
    //         type: "image/png",
    //       },
    //     ],
    //     shortcuts: [
    //       {
    //         name: "Demo",
    //         short_name: "Demo",
    //         url: "/demo/",
    //         icons: [
    //           {
    //             src: "/assets/icon/guide-maskable.png",
    //             sizes: "192x192",
    //             purpose: "maskable",
    //             type: "image/png",
    //           },
    //         ],
    //       },
    //     ],
    //   },
    // },
  },
});
